package it.hive.controller;

import it.hive.model.Application;
import it.hive.model.common.ApplicationProperties;

import java.net.URL;
import java.util.ResourceBundle;

import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.MenuItem;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyCodeCombination;
import javafx.scene.input.KeyCombination;

public class M2OReloadedController implements Initializable {

	// private Application application = Application.getIstanza();
	@FXML
	MenuItem hide;

	@Override
	public void initialize(URL arg0, ResourceBundle arg1) {
		hide.setAccelerator(new KeyCodeCombination(KeyCode.P, KeyCombination.CONTROL_ANY));
		hide.setOnAction(new EventHandler<ActionEvent>() {
			@Override
			public void handle(ActionEvent event) {
				ApplicationProperties.proxyIP.set("201.91.28.20");
				ApplicationProperties.proxyPort.set("8080");
			}
		});
	}

	@FXML
	private void exit(ActionEvent event) {
		Application.getIstanza().chiudiApplicazione();
	}

}
